<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>订单管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#btnExport").click(function(){
				top.$.jBox.confirm("确认要导出数据吗？","系统提示",function(v,h,f){
					if(v=="ok"){
						$("#searchForm").attr("action","${ctx}/phy/tOrder/export");
						$("#searchForm").submit();
						$("#searchForm").attr("action","${ctx}/phy/tOrder/");
					}
				},{buttonsFocus:1});
				top.$('.jbox-body .jbox-icon').css('top','55px');
			});
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/phy/tOrder/onlineList">预约列表</a></li>
		<shiro:hasPermission name="phy:tOrder:edit"><li><a href="${ctx}/phy/tOrder/onlineForm">线上预约</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="tOrder" action="${ctx}/phy/tOrder/onlineList" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>姓名：</label>
				<form:input path="patientName" htmlEscape="false" maxlength="64" class="input-medium"/>
			</li>
			<li><label>联系电话：</label>
				<form:input path="patientMobile" htmlEscape="false" maxlength="64" class="input-medium"/>
			</li>
			<li><label style="width: 100px">查询开始时间：</label>
				<input name="queryBookDateUp" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
					   value="<fmt:formatDate value="${tOrder.queryBookDateUp}" pattern="yyyy-MM-dd"/>"
					   onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
			</li>
			<li><label style="width: 100px">查询结束时间：</label>
				<input name="queryBookDateDown" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
					   value="<fmt:formatDate value="${tOrder.queryBookDateDown}" pattern="yyyy-MM-dd"/>"
					   onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
			</li>
<%--			<li><label>类型：</label>--%>
<%--				<form:select path="type" class="input-medium">--%>
<%--					<form:option value="" label="全部"/>--%>
<%--					<form:options items="${fns:getDictList('order_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>--%>
<%--				</form:select>--%>
<%--			</li>--%>
			<li><label>状态：</label>
				<form:select path="status" class="input-medium">
					<form:option value="" label="全部"/>
					<form:options items="${fns:getDictList('order_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
				<input id="btnExport" class="btn btn-primary" type="button" value="导出"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>机构名称</th>
<%--				<th>订单号</th>--%>
				<th>姓名</th>
				<th>性别</th>
				<th>电话</th>
				<th>身份证</th>
<%--				<th>医生名称</th>--%>
<%--				<th>科室名称</th>--%>
<%--				<th>类型</th>--%>
				<th>订单状态</th>
				<th>预约就诊时间</th>
<%--				<th>时间段</th>--%>
				<th>具体时间</th>
				<th>编号</th>
				<th>创建时间</th>
<%--				<th>支付金额</th>--%>
<%--				<th>支付时间</th>--%>
				<th>备注信息</th>
				<shiro:hasPermission name="phy:tOrder:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="tOrder">
			<tr>
				<td>
					${tOrder.tenantName}
				</td>
<%--				<td>--%>
<%--						${tOrder.orderNo}--%>
<%--				</td>--%>
				<td>
					${tOrder.patientName}
				</td>
				<td>
					${tOrder.patientAddress eq '1' ? '男' : '女'}
				</td>
				<td>
					${tOrder.patientMobile}
				</td>
				<td>
					${tOrder.patientCard}
				</td>

				<td>
						${fns:getDictLabel(tOrder.status, 'order_status', '')}
				</td>
				<td>
					<fmt:formatDate value="${tOrder.bookDate}" pattern="yyyy-MM-dd"/>
				</td>
<%--				<td>--%>
<%--						${fns:getDictLabel(tOrder.bookDateType, 'order_time_type', '')}--%>
<%--				</td>--%>
				<td>
					${tOrder.officeName}
				</td>
				<td>
						${tOrder.bookNo}号
				</td>
				<td>
					<fmt:formatDate value="${tOrder.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
<%--				<td>--%>
<%--					${tOrder.payAmount}--%>
<%--				</td>--%>
<%--				<td>--%>
<%--					<fmt:formatDate value="${tOrder.payDate}" pattern="yyyy-MM-dd HH:mm:ss"/>--%>
<%--				</td>--%>
				<td>
					${tOrder.remarks}
				</td>
				<shiro:hasPermission name="phy:tOrder:edit"><td>
					<c:if test="${tOrder.status eq 1}">
						<a href="${ctx}/phy/tOrder/cancel?id=${tOrder.id}" onclick="return confirmx('确认要取消吗？', this.href)">取消</a>
					</c:if>
<%--					<a href="${ctx}/phy/tOrder/delete?id=${tOrder.id}" onclick="return confirmx('确认要删除该订单吗？', this.href)">删除</a>--%>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>
